package com.cq.hd.product.api;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.product.api.dto.LabelPageDto;
import com.cq.hd.product.api.dto.LabelSaveDto;
import com.cq.hd.product.api.vo.LabelPageVo;
import com.cq.hd.product.api.vo.LabelVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "hd-o2o-product-service", contextId = "label-api")
public interface TbLabelApi {

    @GetMapping("/product/label/page")
    Result<Page<LabelPageVo>> pageLabel(@SpringQueryMap LabelPageDto labelPageDto);

    @PostMapping("/product/label/save")
    Result<LabelVo> saveLabel(@RequestBody LabelSaveDto labelSaveDto);

    @PostMapping("/product/label/delete")
    Result<Void> deleteLabel(@RequestParam("id") Long id);

    @GetMapping("/product/label/recommends")
    Result<List<LabelVo>> listRecommendLabels(@RequestParam("businessId") Long businessId);

    @GetMapping("/product/label/searchByClient")
    Result<List<LabelVo>> searchByClient(@RequestParam("businessId") Long businessId, @RequestParam("keyword") String keyword);

}
